package com.happok.onlineclass.usermanagement.user.service;

import com.happok.onlineclass.usermanagement.user.dataobject.UserPermissionDO;
import org.springframework.security.core.GrantedAuthority;

import java.util.List;
import java.util.Map;

/**
 * 功能说明
 *
 * @author : chenac
 * @version : v1.0
 * @date : 2021/8/16 17:10
 * @updateUser : chenac
 * @updateTime : 2021/8/16 17:10
 * @updateRemark : 无
 * @since : Springboot 2.5.2
 */
public interface UserPermissionDaoService {
    /**
     * 添加用户权限
     *
     * @param userPermissionDO
     * @author: chenac
     * @date: 17:10
     * @execption:
     * @return: void
     */
    void insert(UserPermissionDO userPermissionDO);

    /**
     * 更新用户权限
     *
     * @param userPermissionDO
     * @author: chenac
     * @date: 17:10
     * @execption:
     * @return: void
     */
    void update(UserPermissionDO userPermissionDO);

    /**
     * 删除用户权限
     *
     * @param userPermissionDO
     * @author: chenac
     * @date: 17:10
     * @execption:
     * @return: void
     */
    void delete(UserPermissionDO userPermissionDO);

    /**
     * 查询用户权限是否存在
     *
     * @param userId  用户
     * @param orgId   机构id
     * @param orgType 机构类型
     * @author: chenac
     * @date: 17:44
     * @execption:
     * @return: java.lang.Boolean
     */
    Boolean isUserPermissionExist(Integer userId, Integer orgId, String orgType);

    /**
     * 查询用户权限
     *
     * @param userId
     * @author: chenac
     * @date: 14:02
     * @execption:
     * @return: java.util.Map<java.lang.Integer, java.util.List < org.springframework.security.core.GrantedAuthority>>
     */
    Map<Integer, List<GrantedAuthority>> getTrainOrgAuthorities(Integer userId);

    /**
     * 查询用户权限
     *
     * @param userId
     * @author: chenac
     * @date: 14:02
     * @execption:
     * @return: java.util.Map<java.lang.Integer, java.util.List < java.lang.String>>
     */
    Map<Integer, List<String>> trainOrgAuthorities(Integer userId);

    /**
     * 查询用户权限
     *
     * @param userId
     * @author: chenac
     * @date: 14:03
     * @execption:
     * @return: java.util.Map<java.lang.Integer, java.util.List < org.springframework.security.core.GrantedAuthority>>
     */
    Map<Integer, List<GrantedAuthority>> getEnterpriseAuthorities(Integer userId);

    /**
     * 查询用户权限
     *
     * @param userId
     * @author: chenac
     * @date: 14:03
     * @execption:
     * @return: java.util.Map<java.lang.Integer, java.util.List < java.lang.String>>
     */
    Map<Integer, List<String>> enterpriseAuthorities(Integer userId);

    /**
     * 查询用户权限
     *
     * @param userId
     * @author: chenac
     * @date: 14:03
     * @execption:
     * @return: java.util.List<org.springframework.security.core.GrantedAuthority>
     */
    List<GrantedAuthority> getPlatformAuthorities(Integer userId);

    /**
     * 查询用户权限
     *
     * @param userId
     * @author: chenac
     * @date: 14:03
     * @execption:
     * @return: java.util.List<java.lang.String>
     */
    List<String> platformAuthorities(Integer userId);
}